/**
    ATClab - scriptable Air Traffic Control simulations.
    Copyright (C) 2010 openatclab@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/

#ifndef __ATC_EXPERIMENT_HDR__
#define __ATC_EXPERIMENT_HDR__

#ifdef WIN32
	// disable - decorated name length exceeded
	#pragma warning(disable:4503)
	// disable 'identifier' truncation warning
	#pragma warning(disable:4786)
#endif


#include "document.h"

#include <stdexcept>
#include <vector>


#define PRESENTATION_TASKS std::vector<xml::DocumentNode*>
#define GLOBAL_STATE       std::vector<xml::DocumentNode*>


namespace pact{


	/*!
	 * \struct atc::experiment_error
	 */
	struct experiment_error : public std::runtime_error{
		experiment_error(const std::string& msg) 
			:std::runtime_error(msg){}
	};


	/*!
	 * \class pact::Translator
	 */
	class Translator;


	/*!
	 * \class pact::Experiment atc_experiment.h
	 */
	class Experiment : public xml::Document	{
	public:
		Experiment();
		~Experiment();
	public: // virtual
		virtual void createChild(const std::string&);
		virtual bool validate();
	public:
		const PRESENTATION_TASKS& presentation_tasks() const { return _presentation; }
		const GLOBAL_STATE&       global_state()       const { return _globalState; }     
	private:
		GLOBAL_STATE       _globalState;
		PRESENTATION_TASKS _presentation;
		Translator* _translator;
	};

	typedef PRESENTATION_TASKS                  PresentationTasks;
	typedef PRESENTATION_TASKS::const_iterator  PresentationTasksCIt;
	typedef GLOBAL_STATE                        GlobalState;
	typedef GLOBAL_STATE::const_iterator        GlobalStateCIt;
	typedef xml::DocumentNode					GlobalStateNode;

};

#undef PRESENTATION_TASKS
#undef GLOBAL_STATE


#endif
